<!DOCTYPE html>
<html lang="ch">

	<head>
		<meta charset="UTF-8">
		<meta name="viewport" content="width=device-width,initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no" />
		<link rel="stylesheet" href="css/swiper.min.css">		
		<script src="js/swiper.min.js"></script>
		<script src="js/config.js" type="text/javascript" charset="utf-8"></script>	
		<script src="js/guzhangdeng.js" type="text/javascript" charset="utf-8"></script>
		<script charset="UTF-8" src="js/core.js"></script>
		<script charset="UTF-8" src="js/cipher-core.js"></script>
		<script charset="UTF-8" src="js/tripledes.js"></script>
		<script charset="UTF-8" src="js/mode-ecb.js"></script>
		<script type="text/javascript" src="js/zepto.min.js"></script>
		<script type="text/javascript" src="js/spin.min.js"></script>
		<script type="text/javascript" src="js/template-web.js"></script>
		<script type="text/javascript" src="js/mapDetail.js"></script>
		<!--标准mui.css-->
		<!-- <link rel="stylesheet" href="css/mui.min.css"> -->
		<link rel="stylesheet" type="text/css" href="css/main.css" />
		<title>邀请码</title>
		<script>
			var companyCode = localStorage.getItem("companyCode")
			if(companyCode != null && companyCode != ''){
				window.location.href="fastLogin.html"
			}
		</script>
	</head>

	<body>
	<div class="spin"></div>
	<div style="padding-top: 1px">
		<div class="login">
			<div class="login_portrait_con">
				<div class="invite">
					<img class="invite_bg" src="img/bg_invitation@2x.png">
				</div>
			</div>
			<div class="login_input_con">
				<div class="login_ph">
					<input style="width: 100%;" id="code" onclick="enterInput()" class="login_input" placeholder="请输入邀请码" style="color: rgba(0,0,0,0.6);">
				</div>
			</div>
			<span id="su" class="form-verify-span"></span>
		</div>
	</div>
	<div class="but_tong" onclick="findComCode()">确认</div>
	
	<script type="text/javascript" src="js/jquery-1.8.3.min.js"></script>
	<script src="js/mui.min.js"></script>
	<script type="text/javascript">
		
		function enterInput(){
			$("#su").css("display","none")
		}
		
		function findComCode(){
			var code =  $("#code").val()
			if(code != ""){
				showDialog()
				$.ajax({
		            type: "POST",
		            url: url_prefix + "user/Invite_code",
		            data: {
		            	request: JSON.stringify({
							code:code
						})   
		            },
		            dataType: "json",
		            success: function(data){
		            	//plus.nativeUI.toast(data.message, {verticalAlign: 'center'});
		            	if(data.code == '200'){
		            		localStorage.setItem("companyCode",code)
		            		localStorage.setItem("companyIcon",data.result.companyIcon)
		            		window.location.href = 'fastLogin.html'
		            	}else{
		            		mui.toast(data.message); 
		            	}
		            	dismissDialog()
		            }
		        });
			}else{
				$("#su").css("display","block")
				$("#su").html("邀请码不能为空！")
			}
		}
	</script>
	</body>

</html>